﻿<Window x:Class="PluginV2Tester_Application.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="350" Width="525"
        DataContext="{Binding RelativeSource={RelativeSource Self}}"
        Foreground="Black">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <ListView
            Name="IMangaUpdates"
            Grid.Row="0"
            ItemsSource="{Binding Path=IMangaPluginManagerUpdates}">
            <ListView.View>
                <GridView>
                    <GridViewColumn 
                            Header="Id" 
                            CellTemplate="{DynamicResource ResourceKey=IdCellTemplate}"
                            Width="Auto"/>
                    <GridViewColumn 
                            Header="Progress" 
                            CellTemplate="{DynamicResource ResourceKey=ProgressCellTemplate}"
                            Width="Auto"/>
                    <GridViewColumn 
                            Header="Data" 
                            CellTemplate="{DynamicResource ResourceKey=DataCellTemplate}"
                            Width="Auto"/>
                </GridView>
            </ListView.View>
            <ListView.Resources>
                <DataTemplate x:Key="IdCellTemplate">
                    <TextBlock
                        Text="{Binding Id}"
                        TextAlignment="Center"
                        HorizontalAlignment="Center" 
                        VerticalAlignment="Center"/>
                </DataTemplate>
                <DataTemplate x:Key="ProgressCellTemplate">
                    <ProgressBar 
                        Value="{Binding Progress}"
                        Height="21px"
                        Width="100px"/>
                </DataTemplate>
                <DataTemplate x:Key="DataCellTemplate">
                    <TextBlock
                        Text="{Binding Data}"
                        ToolTip="{Binding Data}"
                        TextAlignment="Center"
                        HorizontalAlignment="Center" 
                        VerticalAlignment="Center"/>
                </DataTemplate>
            </ListView.Resources>
        </ListView>
        <TextBox
            Grid.Row="1" 
            VerticalScrollBarVisibility="Auto"
            Text="{Binding Path=SelectedItem.Data, ElementName=IMangaUpdates}"
            TextWrapping="Wrap" />
        <ListBox Grid.Row="2">
            <ListBox.Items>
                <Button Content="Test Info Download" Click="Button_Click" />
                <Button Content="Test Info Download (RAND Count)" Click="Button_Click" />
            </ListBox.Items>
        </ListBox>
        <ListView
            Grid.Row="3"
            ItemsSource="{Binding Path=PluginInfoModelCollection}">
            <ListView.View>
                <GridView>
                    <GridViewColumn 
                            Header="Name" 
                            CellTemplate="{DynamicResource ResourceKey=NameCellTemplate}"
                            Width="Auto"/>
                    <GridViewColumn 
                            Header="Author" 
                            CellTemplate="{DynamicResource ResourceKey=AuthorCellTemplate}"
                            Width="Auto"/>
                    <GridViewColumn 
                            Header="Supported Methods" 
                            CellTemplate="{DynamicResource ResourceKey=SupportedMethodsCellTemplate}"
                            Width="Auto"/>
                </GridView>
            </ListView.View>
            <ListView.Resources>
                <DataTemplate x:Key="NameCellTemplate">
                    <TextBlock 
                            Text="{Binding Name}"
                            TextAlignment="Center"
                            HorizontalAlignment="Center" 
                            VerticalAlignment="Center"/>
                </DataTemplate>
                <DataTemplate x:Key="AuthorCellTemplate">
                    <TextBlock 
                            Text="{Binding Author}"
                            TextAlignment="Center"
                            HorizontalAlignment="Center" 
                            VerticalAlignment="Center"/>
                </DataTemplate>
                <DataTemplate x:Key="SupportedMethodsCellTemplate">
                    <TextBlock 
                            Text="{Binding SupportedMethods}"
                            TextAlignment="Center"
                            HorizontalAlignment="Center" 
                            VerticalAlignment="Center"/>
                </DataTemplate>
            </ListView.Resources>
        </ListView>
    </Grid>
</Window>
